#include "Kernel.h"
#include "Hal/IHardware.h"
#include "Hal/x86/Hardware.h"
#include "Hal/x86/CPU.h"
#include "Hal/x86/Paging.h"

using namespace x86;

extern uint32 * Kernel_PageDirectory;
extern uint32 * Kernel_PageTable;


Result Paging::Initialize( void )
{
	PAGING_TRACE( "Initializing...\n" );

#if 0
	Address address = 0;
	for( int i = 0; i < 1024; i++ )
	{
		Kernel_PageTable[i] = address | 0x03;
		address += 0x1000;
	}

	Kernel_PageDirectory[0] = (uint32)&Kernel_PageTable[0] | 0x03;

	for( int i = 1; i < 1024; i++ )
		Kernel_PageDirectory[i] = 0x02;

	set_cr3( (uint32)&Kernel_PageDirectory[0] );
	set_cr0( cr0() | 0x80000000 );
#endif

	return RESULT_OK;
}
